unsigned char swapOddEvenBits(unsigned char n)
{
    unsigned char mask1 = 0xAA;
    unsigned char mask2 = 0x55;

    unsigned char evenBits = n & mask1; 
    unsigned char oddBits = n & mask2; 

    evenBits = evenBits >> 1; 
    oddBits = oddBits << 1;  

    return (evenBits | oddBits ); 
}


int main()
{
    unsigned int x = 23; // 00010111
    printf("%u ", swapOddEvenBits(x));
    return 0;
}